package com.security.door.service.Impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.security.door.core.base.BaseService;
import com.security.door.dao.mapper.calendarAttendanceMapper;
import com.security.door.model.domain.calendarAttendance;
import com.security.door.model.dto.recordAttendanceDto;
import com.security.door.model.vo.attenScheduleVo;
import com.security.door.service.IcalendarAttendanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class calendarAttendanceServiceImpl extends BaseService<calendarAttendance> implements IcalendarAttendanceService {
    @Autowired
    calendarAttendanceMapper irecordAttendanceMapper;

    public PageInfo<calendarAttendance> queryListWithPage(recordAttendanceDto entity) {
        PageHelper.startPage(entity.getPageIndex(), entity.getPageSize());
        var actionList = irecordAttendanceMapper.queryListWithPage(entity);
        return new PageInfo<>(actionList);
    }

    public calendarAttendance selectByDate(String attDate, String persionCode) {
        return irecordAttendanceMapper.selectByDate(attDate, persionCode);
    }

    public attenScheduleVo selectByPerionCode(String persionCode) {
        return irecordAttendanceMapper.selectByPerionCode(persionCode);
    }
}